/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rockville.testing;

import java.io.File;
import java.io.FileFilter;
import org.apache.log4j.Logger;

/**
 *
 * @author Usman
 */
public class ImageFileFilter implements FileFilter {
    private final String[] okFileExtensions = new String[] {"jpg", "png", "gif"};
    private static final Logger log=Logger.getLogger(ImageFileFilter.class);
    
    public boolean accept(File file) {
        for (String extension : okFileExtensions) {
            if (file.getName().toLowerCase().endsWith(extension)) {
                return true;
            }
        }
        return false;
    }
}
